public class BankAccount {
    private String accountNumber;
    private double balance;
    private String accountHolder;


    public BankAccount(String accountNumber, double balance, String accountHolder) {
        this.accountNumber = accountNumber;
        this.balance = balance;
        this.accountHolder = accountHolder;
    }

    //存款
    public void deposit(double amount) {
        System.out.println("存款");
        balance += amount;
    }

    //取款
    public void withdraw(double amount) {
        if (balance >= amount) {
            System.out.println("取款");
            balance -= amount;
        } else {
            System.out.println("金额不足");
        }
    }

    public double getBalance() {
        return balance;
    }

     public String getAccountNumber() {
        return accountNumber;
    }

     public String getAccountHolder() {
        return accountHolder;
    }

    public void displayAccountInfo() {
        System.out.println("账户号" + accountNumber);
        System.out.println("账户持有人: " + accountHolder);
        System.out.println("余额: " + balance);
    }
}
